#include<stdio.h>

int main(void)
{
	int n, m;
	int flag = 0;

	scanf("%d %d", &n, &m);
	int n1 = n;
	int m1 = m;
	while(!flag){
		int tem = n;
		n = m % n;
		m=tem;
		if(0 == n){
			flag = 1;
			printf("%d和%d的最大公约数为：%d\n", n1, m1, m);
		}
	}	
	return 0;
}
